package com.gitee.sop.layui.adminserver.module.background.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gitee.sop.layui.adminserver.module.background.admin.entity.SysUserApplicationRelation;
import com.gitee.sop.layui.adminserver.module.background.admin.mapper.SysUserApplicationRelationMapper;
import com.gitee.sop.layui.adminserver.module.background.admin.service.SysUserApplicationRelationService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 后台管理员和应用的关联关系 服务实现类
 * </p>
 *
 * @author admin
 * @since 2020-04-24
 */
@Service
public class SysUserApplicationRelationServiceImpl extends ServiceImpl<SysUserApplicationRelationMapper, SysUserApplicationRelation> implements SysUserApplicationRelationService {

    @Override
    public int countByAppId(String appId) {
        return this.baseMapper.selectCountByAppId(appId);
    }

    @Override
    public void removeByAppId(String appId) {
        this.baseMapper.deleteByAppId(appId);
    }

    @Override
    public void removeByUserUuidAndAppId(String userUuid, String appId) {
        this.baseMapper.deleteByUserUuidAndAppId(userUuid, appId);
    }

    @Override
    public SysUserApplicationRelation getOneByUserUuidAndAppId(String userUuid, String appId) {
        return this.baseMapper.selectOneByUserUuidAndAppId(userUuid, appId);
    }
}
